<%@ page contentType="text/html; charset=UTF-8" language="java"
	pageEncoding="UTF-8"%>
<%@ include file="../include/corptaglibs.jsp"%><head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title></title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="-1000">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<LINK href="${ctx }/corp/css/css.css" type=text/css rel=stylesheet>
	<SCRIPT src="${ctx }/corp/js/jquery.js" type=text/javascript></SCRIPT>
	<SCRIPT src="${ctx }/corp/js/interface.js" type=text/javascript></SCRIPT>
	<LINK href="${ctx }/corp/css/style.css" type="text/css" rel="stylesheet">
	<style type="text/css">
<!--
#Layerdis {
	position:absolute;
	left:86px;
	top:35px;
	width:23px;
	height:23px;
	z-index:1;
	font-weight:600;
	font-size:12px;
	
}
#Layer1 {	
	cursor:hand;


}
#Layer2 {
	position:absolute;
	left:295px;
	top:260px;
	width:331px;
	height:98px;
	z-index:2;
	}
	#Layer4 {
	position:absolute;
	left:295px;
	top:260px;
	width:331px;
	height:98px;
	z-index:2;
	}
#Layer3 {
	position:absolute;
	left:38px;
	top:34px;
	width:166px;
	height:98px;
	z-index:2;
}
.filterclass{

filter:Gray;
}
.emptyclass{
}
-->
    </style>
<script language="javascript">
var flagtime=0;
var innerhtml="";
var dragstartid="";
function exchangeimage(thisid){
if(flagtime==0){
innerhtml=document.getElementById(thisid).innerHTML;
document.getElementById("Layer3").innerHTML=innerhtml;
document.getElementById("Layer3").style.display="block";
dragstartid=thisid;
flagtime++;

 document.getElementById(thisid).style.opacity = 0; 
 document.getElementById(thisid).filters.Alpha.opacity =30; 

}
else{
  //alert(thisid);
  //alert(dragstartid);
 
  doexchange(thisid);
  flagtime=0;
  innerhtml="";
  dragstartid="";
  document.getElementById("Layer3").innerHTML="";
  document.getElementById("Layer3").style.display="none";  
  
  }
}
function doexchange(thisid){

 var thisinnerhtml=document.getElementById(thisid).innerHTML;
 document.getElementById(thisid).innerHTML=innerhtml;
 document.getElementById(dragstartid).innerHTML=thisinnerhtml;
// alert(document.getElementById(thisid).innerHTML);
// alert( document.getElementById(dragstartid).innerHTML);
document.getElementById(dragstartid).style.opacity = 0; 
 document.getElementById(dragstartid).filters.Alpha.opacity =100; 
 memery(dragstartid,innerhtml,thisid,thisinnerhtml);
 clickstepnum=1; 
 document.getElementById("laststep").className="emptyclass";
 document.getElementById("nextstep").className="filterclass";
}
//记忆功能(类似于编辑器 )
var step=new Array();
var tempstep=new Array();
//当点击第一张图片时记忆
function memery(dragstartid,innerhtml,thisid,thisinnerhtml){
var num=tempstep.length;
if(num<=9){
tempstep[num]=new Array();
tempstep[num][0]=dragstartid;
tempstep[num][1]=innerhtml; 
tempstep[num][2]=thisid;
tempstep[num][3]=thisinnerhtml; 
}
else
{
getsteps();//大于10步将清除前面的步骤



tempstep[num-1]=new Array();
tempstep[num-1][0]=dragstartid;
tempstep[num-1][1]=innerhtml; 
tempstep[num-1][2]=thisid;
tempstep[num-1][3]=thisinnerhtml; 
}
step=tempstep;
//alert(step.length);

}

//操作部数大于一定数时将清除前面的步骤



function getsteps(){
var tempstep0=new Array();
for(var i=0;i<step.length;i++){
  if(i>0) 
  {
  tempstep0[i-1]=new Array();
  tempstep0[i-1][0]=step[i][0];
  tempstep0[i-1][1]=step[i][1];
  tempstep0[i-1][2]=step[i][2];
  tempstep0[i-1][3]=step[i][3];
  
  }
 }
 step=null;
 step=new Array();
 tempstep=tempstep0;
 step=tempstep0;
 tempstep0=null;
}
//点击返回按钮操作(ctr+z)
var clickstepnum=1;
function clickmemeryforward(id){
var num=step.length;
if(clickstepnum<=num){
document.getElementById(step[num-clickstepnum][0]).innerHTML=step[num-clickstepnum][1];
document.getElementById(step[num-clickstepnum][2]).innerHTML=step[num-clickstepnum][3];
if(clickstepnum==num) document.getElementById(id).className="filterclass";

     document.getElementById("nextstep").className="emptyclass";
 
  clickstepnum++;
}

}
//点击前进按钮操作(ctr+y)
function clickmemerybackward(id){
if(clickstepnum>1){
clickstepnum--;
var num=step.length;
document.getElementById(step[num-clickstepnum][0]).innerHTML=step[num-clickstepnum][3];
document.getElementById(step[num-clickstepnum][2]).innerHTML=step[num-clickstepnum][1];
if(clickstepnum==1) document.getElementById(id).className="filterclass";


  
  document.getElementById("laststep").className="emptyclass";
 }
  
}

<!-- 
function doKeyDown() 
{ 
//alert(event.keyCode);
if (event.ctrlKey && event.keyCode == 90) 
{ 
clickmemeryforward("laststep");
} 
else if (event.ctrlKey && event.keyCode == 89) 
{ 
clickmemerybackward("nextstep");
}

else if(event.keyCode==27) parent.closelayer(false); 
else if(event.keyCode==46)  morerealdelete();
} 
//--> 

//控制层跟着鼠标移动
function controllayer(){
//alert("ok");
var x=window.event.clientX+document.body.scrollLeft;
var y=window.event.clientY+document.body.scrollTop;
document.getElementById("Layer3").style.left=x-50;
document.getElementById("Layer3").style.top=y+5;
}
window.document.onmousemove=controllayer;

var seletnum=0;
 function selectall(thisid){
  var str=document.getElementsByName("pubid");
 // alert(document.getElementById(thisid).checked);
  if(seletnum==0){
  for(var i=0;i<str.length;i++){
   document.getElementsByName("pubid")[i].checked=true;
 }
 seletnum=1;
 }
 else
 {
 for(var i=0;i<str.length;i++){
   document.getElementsByName("pubid")[i].checked=false;
 }
 seletnum=0;
 }
 }
 function geturl(){
var str=document.getElementsByName("pubid");
var string="";
if(str.length>0)
for(var i=0;i<str.length;i++){
  if(document.getElementsByName("pubid")[i].checked==true){
    string+=str[i].value;
  }
}
return string;
}
function closelayer(flag){
  document.getElementById("Layer2").style.display="none";
  if(flag==true)
  window.document.location.reload();

}
function closelayersecond(flag){
  document.getElementById("Layer4").style.display="none";
  if(flag==true)
  window.document.location.reload();

}
//多项选择删除
function morerealdelete(){
//var url='${ctx }/corp/publication.do?m=deletepub';              

//url+=geturl();
//document.getElementById("Layer2").style.display="block";
// alert(url);
 //  document.getElementById("Layer2").style.top=145;
//  document.getElementById("Layer2").style.left=60;
//   document.getElementById("Layer2").style.width=700;
 //   document.getElementById("Layer2").style.height=350
 // var str="<iframe   name=\"modifyiframe\" width=\"100%\" src=\""+url+"\" frameborder=\"0\" align=\"middle\" hspace=\"0\" vspace=\"0\"  height=\"100% \" />";
 // document.getElementById("Layer2").innerHTML=str;  
 if(window.confirm("确认删除吗?")){
document.getElementsByName("m")[0].value="deletepub";
document.publicationBean.submit();
}
}
//删除一项



function realdelete(url){   
if(window.confirm("确定删除吗?")){   
document.getElementById("Layer2").style.display="block";
// alert(url);
   document.getElementById("Layer2").style.top=145+document.body.scrollTop;
  document.getElementById("Layer2").style.left=60+document.body.scrollLeft;
   document.getElementById("Layer2").style.width=700;
    document.getElementById("Layer2").style.height=350
  var str="<iframe   name=\"modifyiframe\" width=\"100%\" src=\""+url+"\" frameborder=\"0\" align=\"middle\" hspace=\"0\" vspace=\"0\"  height=\"100% \" />";
  document.getElementById("Layer2").innerHTML=str; 
  } 
}
function dosubmit(){
var tempstr="";
for(var i=0;i<document.getElementsByName("publicationpageid").length;i++){
tempstr=document.getElementById("image"+i).firstChild.value;
 document.getElementById("publicationpageid"+i).value=document.getElementById("publicationpageid"+i).value+tempstr; 
 alert(document.getElementById("publicationpageid"+i).value);
 }
 document.publicationBean.submit();
}
//控制图片放大显示
function showpic(src){  
   document.getElementById("Layer4").style.display="block";
  document.getElementById("Layer4").style.top=event.clientY+document.body.scrollTop-80;
    document.getElementById("Layer4").style.left=event.clientX+document.body.scrollLeft+50;
   document.getElementById("Layer4").style.width=140;
   document.getElementById("Layer4").style.height=190;
   var str="<table border=\"1\" bordercolor=\"#666666\"><tr><td><img src=\""+src+"\" height=\"170\" width=\"120\"></td></tr></table>";
   document.getElementById("Layer4").innerHTML=str;
  
}

</script>	
	<SCRIPT type=text/javascript>
	
	$(document).ready(
		function()
		{
			$('#dock').Fisheye(
				{
					maxWidth: 25,
					items: 'a',
					itemsText: 'span',
					container: '.dock-container',
					itemWidth: 45,
					proximity: 90,
					halign : 'left'
				}
			)
			
		}
	);

</SCRIPT>
</head>
<body  onkeydown="doKeyDown();">
<div id="Layer2" class=Layer2 ></div>
<div id="Layer4" class=Layer4 ></div>
<div id="Layer3"></div>
<html:html>
<DIV >
	<html:form action="publication.do" method="post">
		<html:hidden property="m" value="editpubcontent" />
		<html:hidden property="publication.publicationid" />
	
		<TABLE cellSpacing=6 cellPadding=1  border=0 style="WIDTH: 100%">
			<TBODY>
				<TR>
					<TD class=pic1wblue vAlign=top align=left bgColor=#ffffff>
						<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
							<TBODY>

								<TR>
									<TD>

										<TABLE class=tableBorder1 style="WIDTH: 100%" cellSpacing=3
											cellPadding=3>
											<TBODY>
												<TR>
													<TD>
														<SPAN style="COLOR: dodgerblue">
															<TABLE style="FONT-WEIGHT: bold; WIDTH: 100%"
																cellSpacing=0 cellPadding=0>
																<TBODY>
																	<TR>
																		
    <td width="8%" align="right"><img src="${ctx }/corp/images/pic_shutu.gif" width="64" height="48" /></td>
    <td width="11%" align="left" valign="middle"  background="${ctx }/corp/images/pic_shutu1.gif"><span class="h3">电子书管理</span></td>
    <td colspan="2"><span id="submitmessage" /></td>

																	
																	</TR>
																</TBODY>
															</TABLE>
														</SPAN>
													</TD>
												</TR>

												<TR>
													<TD style="WIDTH: 100%">
														<TABLE  align="left" style="WIDTH: 100%">
															<TBODY>
																<TR>
																	<TD style="WIDTH: 60%" >

																		<STRONG>电子书内容</STRONG>
																  	</TD>
																  	<td colspan="6" align="left" >																  
																  	 															  	  
																  <DIV class=dock id=dock>
																  	<DIV class=dock-container>
																 
																 <A class=dock-item ><img src="${ctx }/corp/images/table-9.gif"  class="filterclass"  style="cursor:hand;"  id="laststep"  onclick="javascript:clickmemeryforward(this.id);" />
																  <span>上一步(Ctr+z)</span></A>
																 														  
																  
														       <A class=dock-item > <img src="${ctx }/corp/images/table-8.gif"  class="filterclass" style="cursor:hand;"  id="nextstep" onclick="javascript:clickmemerybackward(this.id);"/> <span>下一步(Ctr+y)</span></A>
																  
																 <A class=dock-item > <img src="${ctx }/corp/images/table-6.gif"  style="cursor:hand;" id="selecttedall"  onclick="javascript:selectall(this.id);"/> <span>全选</span></A>
																 
																<A class=dock-item > <img src="${ctx }/corp/images/table-5.gif" style="cursor:hand;"  onclick="morerealdelete()" /> <span>删除所选(Delete)</span></A>
																 
																<A class=dock-item > <img src="${ctx }/corp/images/table-4.gif"  style="cursor:hand;"   onclick="parent.closelayer(false);"/> <span>返回(Esc)</span></A>
																  	</DIV>
																  	 </DIV>																  	
																  	 
																  	</td>
														     
																</TR>
																<tr>
																<td colspan="7">
																<hr/>
																</td>
																</tr>
																<tr>
																<td colspan="7">
																<table >
																<tr style="cursor:default">
   <td  >  <img  src="${ctx}/${requestScope.imagepath}${requestScope.publication.pubpath}/${requestScope.bookurl}small_${requestScope.publication.thumbpath}" style="border:2px solid #949494;width:90 ;height:130 " /> </td>
   <td width="100"></td>
    <td  align="center">  <img  src="${ctx}/${requestScope.imagepath}${requestScope.publication.pubpath}/${requestScope.bookurl}small_${requestScope.publication.endpath}" style="border:2px solid #949494;width:90 ;height:130 " /> </td>
	
	
   </tr>
   <tr>
   <td  align="center" >封面图</td>
    <td width="100"></td>
    <td  align="center">封底图</td>
	
  
   </tr>
	</table>	
	</td></tr>
	<tr>
	

																<tr>
																  <td colspan="7"  ><hr/></td>
															  </tr>	
															  	
													  												
	<c:set var="i" value="0" scope="page"/>
	<tr>
	<td colspan="7">
<div id="content">
<table align="left" style="WIDTH: 100%" border="0">
<tr>
  
<c:forEach var="publicationlist" items="${requestScope.list}">  
   <c:if test="${i%6==0&&i!=0}">
    </tr>
     <tr><td colspan="6"><hr style="BORDER-BOTTOM-STYLE: dotted; BORDER-LEFT-STYLE: dotted; BORDER-RIGHT-STYLE: dotted; BORDER-TOP-STYLE: dotted" color=#111111 size=1/></td></tr>
	 <tr>
	</c:if>
	<td style="display:none"><input type="hidden" name="publicationpageid" id="publicationpageid${i}" value="${publicationlist.publicationpageid }" />  </td>
    <td  align="left" >  
   <table align="center" width="95%"  style="height:170;border:0px " cellpadding="0" cellspacing="0"   >
	 <tr>
	  <td>
	  
	   
    <div   id="image${i}"  style="opacity:0;filter:alpha(opacity=100);" onclick="exchangeimage(this.id)"  align="left" style="width:80 ;height:79 ;cursor:hand"> 	
	<input type="hidden" name="ipagepath"  value="${publicationlist.ipagepath}"/>
    <img   src="${ctx}/${requestScope.imagepath}${requestScope.publication.pubpath }/${requestScope.bookurl}${publicationlist.thumbpath}"     style="border:2px solid #949494;width:90 ;height:130 "/>
    </div>		
     </td>
	 </tr>
	 <tr>
	 <td>	 &nbsp;
	 <input type="checkbox"  name="pubid" value="${publicationlist.publicationpageid}/${publicationlist.orderby}/${requestScope.publication.publicationid }"/>&nbsp;&nbsp;第${publicationlist.orderby}页 <a href="javascript: realdelete('${ctx }/corp/publication.do?m=deletepub&pubid=${publicationlist.publicationpageid}/${publicationlist.orderby}/${requestScope.publication.publicationid }')">&nbsp; 删除</a>	</td>
	</tr>
	</table>
	</td>  
<c:set var="i" value="${i+1}" scope="page"/>
</c:forEach> 
	</tr>	
	</table>														
</div>
</td>
</tr>															</TBODY>
														</TABLE>
													</TD>
												</TR>
												
												<TR>

													<TD  align=left>
														<TABLE style="WIDTH: 100%" cellSpacing=3 cellPadding=3>

															<TR>
																<TD align="center" >
																
																	<input type="button" value="确认排序提交" onClick="submit();"/>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
																	<input type="button" value="返回上一级" onClick="javascript:parent.closelayer(false);"/>
																															</TD>
							
														
															</TR>
															<TR>
																<TD >
																	<hr  />																</TD>
															</TR>
														</TABLE>
													</TD>
												</TR>
												<TR>
													<TD style="WIDTH: 150px" align=right></TD>
													<TD></TD>
												</TR>
											</TBODY>
										</TABLE>
									</TD>
								</TR>

								<TR>
									<TD style="WIDTH: 660px"></TD>
								</TR>
							</TBODY>
						</TABLE>
					</TD>
				</TR>
			</TBODY>
		</TABLE>
		</TD>
		</TR>
		</TBODY>
		</TABLE>
</DIV>
</s:form>
</body>
</html>
